package bizlogic;

import java.sql.SQLException;
import java.util.Vector;
import java.util.ArrayList;
import javax.servlet.http.HttpSession;
import controller.*;
import dao.*;
import dao.mysql.*;
import model.*;

public class ApproveActionCL extends ApproveSupport {
	
	public String execute(){

		HttpSession session = request.getSession();

			System.out.println("In ApprovalViewAction");

			// Get employee from UserSession
			EmployeeSession employeeSession = (EmployeeSession) session
					.getAttribute("EMPLOYEESESSION");
			EmployeeDTO manager = employeeSession.getEmployee();
			System.out.println("ApprovalViewAction " + manager.getEmployeeID());

			//LeaveTypeDAO leave = LeaveD();
			//Vector v = new Vector();
			EmployeeDTO[] subordinates = employeeSession.getSubordinates();
			for (int i = 0; i < subordinates.length; i++) {
				EmployeeDTO sub = subordinates[i];
			}
			return "success";
	}
}
//				Leave[] courses = courseDAO.findCoursesPendingByEmployee(sub
//						.getEmployeeId());

//				Vector LeaveList = new Vector();
//				for (int j = 0; j < LeaveList.length; j++) {
//
//					LeaveList.add(LeaveList[j]);
//				}
//				if (courses.length > 0) {
//					EmployeeCourses courseList = new EmployeeCourses();
//					courseList.setEmployee(sub);
//					courseList.setCourses(courseVec);
//					v.add(courseList);
//				}
//			}
//			EmployeeCourses[] result = new EmployeeCourses[v.size()];
//			result = (EmployeeCourses[]) v.toArray(result);
//			request.setAttribute("employeeCourseLists", result);
//
//			

 
	

